package com.zl.task.service.impl;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import com.zl.task.service.IServiceToken;
import org.springframework.stereotype.Service;

/**
 * @author YinlinGeng
 */
@Service
public class ServiceTokenImpl implements IServiceToken {
    /**
     * 生成token
     *
     * @param
     * @return
     */
    @Override
    public String getToken(String id, String password) {
        String token="";
        token= JWT.create().withAudience(id)
                .sign(Algorithm.HMAC256(password));
        return token;
    }
}
